inherited frmBillMnfMachiningQuery: TfrmBillMnfMachiningQuery
  Left = 236
  Top = 70
  Caption = #36873#25321#29983#20135#21152#24037#21333#29289#26009
  ClientHeight = 613
  ExplicitHeight = 640
  PixelsPerInch = 96
  TextHeight = 12
  inherited pnlBottom: TPanel
    Top = 558
    ExplicitTop = 558
    inherited pgcIndustry: TPageControl
      inherited tsFuturesPrice: TTabSheet
        ExplicitLeft = 4
        ExplicitTop = 18
        ExplicitWidth = 444
        ExplicitHeight = 19
        inherited edtFuturesPrice: TcxCurrencyEdit
          ExplicitHeight = 20
        end
      end
      inherited tsIndustry: TTabSheet
        inherited cxLabel1: TcxLabel
          Transparent = True
        end
      end
    end
  end
  inherited pnlMain: TPanel
    Height = 517
    ExplicitHeight = 517
    inherited pnlData: TPanel
      Height = 65
      ExplicitHeight = 65
      inherited cxGrid1: TcxGrid
        Height = 57
        ExplicitHeight = 57
      end
      object cxSplitter1: TcxSplitter
        Left = 0
        Top = 57
        Width = 799
        Height = 8
        HotZoneClassName = 'TcxXPTaskBarStyle'
        AlignSplitter = salBottom
        Control = pnlDtl
      end
    end
    inherited pnlOftenFilter: TPanel
      TabOrder = 3
    end
    object pnlDtl: TPanel
      Left = 0
      Top = 337
      Width = 799
      Height = 180
      Align = alBottom
      BevelOuter = bvNone
      TabOrder = 2
      object pnlRaw: TPanel
        Left = 0
        Top = 0
        Width = 799
        Height = 70
        Align = alClient
        BevelOuter = bvNone
        TabOrder = 0
        object grdRaw: TcxGrid
          Left = 0
          Top = 0
          Width = 799
          Height = 70
          Align = alClient
          TabOrder = 0
          object viewRaw: TcxGridDBTableView
            OnMouseDown = cxGrid1DBTableView1MouseDown
            Navigator.Buttons.CustomButtons = <>
            DataController.DataModeController.GridMode = True
            DataController.DataSource = dsRaw
            DataController.Summary.DefaultGroupSummaryItems = <>
            DataController.Summary.FooterSummaryItems = <>
            DataController.Summary.SummaryGroups = <>
            OptionsBehavior.FocusCellOnTab = True
            OptionsBehavior.FocusCellOnCycle = True
            OptionsData.Deleting = False
            OptionsData.Inserting = False
            OptionsView.ColumnAutoWidth = True
            OptionsView.GroupByBox = False
            OptionsView.Indicator = True
            OptionsView.IndicatorWidth = 30
            Styles.Background = MainDM.bslBackGroup
            Styles.ContentEven = MainDM.bsEven
            Styles.ContentOdd = MainDM.bsOdd
            Styles.Header = MainDM.bsTitle
            Styles.Selection = MainDM.bsSelect
            OnCustomDrawIndicatorCell = cxGrid1DBTableView1CustomDrawIndicatorCell
            object viewRawchoice: TcxGridDBColumn
              Caption = #36873#25321
              DataBinding.FieldName = 'choice'
              PropertiesClassName = 'TcxCheckBoxProperties'
              Properties.ImmediatePost = True
              Width = 30
            end
            object viewRawm_bcode: TcxGridDBColumn
              Caption = #21333#21495
              DataBinding.FieldName = 'm_bcode'
              Width = 80
            end
            object viewRawrp_code: TcxGridDBColumn
              Caption = #26448#26009#32534#30721
              DataBinding.FieldName = 'rp_code'
              Width = 80
            end
            object viewRawrp_name: TcxGridDBColumn
              Caption = #26448#26009#21517#31216
              DataBinding.FieldName = 'rp_name'
              Width = 80
            end
            object viewRawrp_spec: TcxGridDBColumn
              Caption = #35268#26684
              DataBinding.FieldName = 'rp_spec'
              Width = 80
            end
            object viewRawunitname: TcxGridDBColumn
              Caption = #21333#20301
              DataBinding.FieldName = 'unitname'
              Width = 50
            end
            object viewRawquantity: TcxGridDBColumn
              Caption = #38656#27714#25968#37327
              DataBinding.FieldName = 'quantity'
              Width = 80
            end
            object viewRawformerdrawqty: TcxGridDBColumn
              Caption = #24050#39046#25968#37327
              DataBinding.FieldName = 'formerdrawqty'
              Width = 80
            end
            object viewRawformerwastedqty: TcxGridDBColumn
              Caption = #20351#29992#25968#37327
              DataBinding.FieldName = 'formerwastedqty'
              Width = 80
            end
            object viewRawactQty: TcxGridDBColumn
              Caption = #26412#27425#38656#27714
              DataBinding.FieldName = 'actQty'
              Width = 80
            end
            object viewRawassqty: TcxGridDBColumn
              Caption = #36741#21161#25968#37327
              DataBinding.FieldName = 'assqty'
              Width = 80
            end
          end
          object lvlRaw: TcxGridLevel
            GridView = viewRaw
          end
        end
      end
      object pnlSub: TPanel
        Left = 0
        Top = 70
        Width = 799
        Height = 110
        Align = alBottom
        BevelOuter = bvNone
        TabOrder = 1
        Visible = False
        object grdSub: TcxGrid
          Left = 0
          Top = 0
          Width = 799
          Height = 110
          Align = alClient
          TabOrder = 0
          object viewSub: TcxGridDBTableView
            Navigator.Buttons.CustomButtons = <>
            DataController.DataModeController.GridMode = True
            DataController.DataSource = dsSub
            DataController.Summary.DefaultGroupSummaryItems = <>
            DataController.Summary.FooterSummaryItems = <>
            DataController.Summary.SummaryGroups = <>
            OptionsBehavior.FocusCellOnTab = True
            OptionsBehavior.FocusCellOnCycle = True
            OptionsData.Deleting = False
            OptionsData.Inserting = False
            OptionsView.ColumnAutoWidth = True
            OptionsView.GroupByBox = False
            OptionsView.Indicator = True
            OptionsView.IndicatorWidth = 30
            Styles.Background = MainDM.bslBackGroup
            Styles.ContentEven = MainDM.bsEven
            Styles.ContentOdd = MainDM.bsOdd
            Styles.Header = MainDM.bsTitle
            Styles.Selection = MainDM.bsSelect
            OnCustomDrawIndicatorCell = cxGrid1DBTableView1CustomDrawIndicatorCell
            object viewSubchoice: TcxGridDBColumn
              Caption = #36873#25321
              DataBinding.FieldName = 'choice'
              PropertiesClassName = 'TcxCheckBoxProperties'
              Properties.ImmediatePost = True
              Width = 30
            end
            object viewSubm_bcode: TcxGridDBColumn
              Caption = #21333#21495
              DataBinding.FieldName = 'm_bcode'
              Width = 80
            end
            object viewSuborderno: TcxGridDBColumn
              Caption = #24207#21495
              DataBinding.FieldName = 'orderno'
              Width = 80
            end
            object viewSubrp_code: TcxGridDBColumn
              Caption = #26448#26009#32534#30721
              DataBinding.FieldName = 'rp_code'
              Width = 80
            end
            object viewSubrp_name: TcxGridDBColumn
              Caption = #26448#26009#21517#31216
              DataBinding.FieldName = 'rp_name'
              Width = 80
            end
            object viewSubp_code: TcxGridDBColumn
              Caption = #26367#20195#21697#32534#30721
              DataBinding.FieldName = 'p_code'
              Width = 80
            end
            object viewSubp_name: TcxGridDBColumn
              Caption = #26367#20195#21697#21517#31216
              DataBinding.FieldName = 'p_name'
              Width = 80
            end
            object viewSubp_spec: TcxGridDBColumn
              Caption = #35268#26684
              DataBinding.FieldName = 'p_spec'
              Width = 80
            end
            object viewSubunitname: TcxGridDBColumn
              Caption = #21333#20301
              DataBinding.FieldName = 'unitname'
              Width = 50
            end
            object viewSubrate: TcxGridDBColumn
              Caption = #26367#20195#29575
              DataBinding.FieldName = 'rate'
              Width = 50
            end
            object viewSubquantity: TcxGridDBColumn
              Caption = #38656#27714#25968#37327
              DataBinding.FieldName = 'quantity'
              Width = 80
            end
            object viewSubdrawqty: TcxGridDBColumn
              Caption = #24050#39046#25968#37327
              DataBinding.FieldName = 'drawqty'
              Width = 80
            end
            object viewSubwastedqty: TcxGridDBColumn
              Caption = #20351#29992#25968#37327
              DataBinding.FieldName = 'wastedqty'
              Width = 80
            end
          end
          object lvlSub: TcxGridLevel
            GridView = viewSub
          end
        end
      end
    end
  end
  inherited pnlTop: TPanel
    inherited btnExport: TcxButton
      TabOrder = 4
    end
    inherited chkDetail: TcxCheckBox
      Left = 194
      TabOrder = 9
      ExplicitLeft = 194
    end
    inherited chkGridFilter: TcxCheckBox
      Left = 273
      ExplicitLeft = 273
    end
    object btnSub: TcxButton
      Left = 347
      Top = 8
      Width = 75
      Height = 25
      Caption = #26367#20195#21697
      TabOrder = 2
      OnClick = btnSubClick
    end
    object chkChoiceOneBill: TcxCheckBox
      Left = 448
      Top = 10
      Hint = #31995#32479#31649#29702#21592#35774#32622
      Caption = #25353#21333#36873#25321#29289#26009
      TabOrder = 10
      OnClick = chkChoiceOneBillClick
    end
  end
  inherited pnlBtype: TPanel
    Height = 517
    ExplicitHeight = 517
    inherited trBType: TcxTreeView
      Height = 517
      ExplicitHeight = 517
    end
  end
  inherited sptBType: TcxSplitter
    Height = 517
    ExplicitHeight = 517
  end
  inherited cxStyleRepository1: TcxStyleRepository
    Left = 64
    Top = 322
    PixelsPerInch = 96
  end
  inherited qryBillU: TUniQuery
    AfterScroll = cdsBillAfterScroll
  end
  object qryRaw: TUniQuery
    Connection = MainDM.UniConn
    SQL.Strings = (
      
        'Select m.*,d.bid ,d.bno, d.bdtlno, d.productid as rawproductid, ' +
        'd.cprice, d.bprice, d.bquantity,   '
      
        'd.amount, d.unitid, d.quantity, d.price, d.unit1qty, d.unit2qty,' +
        ' d.unit3qty,  '
      'd.relationassqty, d.batchcode, d.productdate, d.validdate, '
      
        'd.drawqty,  d.drawamt, d.wastedqty, d.wastedamt, d.relationcount' +
        ', d.relationbtype,  d.relationbid, d.relationbno, d.relationpid,' +
        ' d.relationqty, '
      
        'd.ioqty,  d.custom1, d.custom2, d.custom3, d.explan, d.workproci' +
        'd, d.formerdrawqty, d.formerwastedqty, '
      
        ' (d.quantity-d.drawqty) as actQty, (d.quantity-d.drawqty) as fac' +
        'tQty,  '
      
        'rp.code as rp_code,rp.name as rp_name,rp.spec as rp_spec,u.unitn' +
        'ame,   '
      'cast(0 as bit) as choice, m_bcode,   m.saleorderbcode,  '
      'mp.name as mp_name, mp.code as mp_code, mp.spec as mp_spec,  '
      ' d.drawqty as fdrawqty, d.wastedqty as fwastedqty,   '
      
        'case abs(round((abs(d.quantity)-d.drawqty)/d.quantity * d.assqty' +
        ', 4))     '
      
        'when 0 then d.assqty     else abs(round((abs(d.quantity)-d.drawq' +
        'ty)/d.quantity * d.assqty, 4))   end as assqty   '
      'from v_tb_mnfmachiningrawmaterials d    '
      'left join v_tb_mnfmachining m on d.bid=m.bid and m.bno=d.bno   '
      'left outer join td_product rp on (d.productid=rp.p_id)    '
      'left outer join td_product mp on (m.productid=mp.p_id)   '
      
        'left outer join td_unitprice u on (d.unitid=u.unitid and d.produ' +
        'ctid=u.productid)    '
      
        'where m.pause=0 and m_bstate=1 and m.workshopid=2 and m.quantity' +
        '>m.completedqty+m.wasterqty and d.quantity>d.drawqty  '
      
        'and (m.completedqty+m.wasterqty=0 or (m.completedqty+m.wasterqty' +
        '>0 and d.drawqty>0))')
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Left = 76
    Top = 453
  end
  object qrySub: TUniQuery
    Connection = MainDM.UniConn
    SQL.Strings = (
      'Select sub.*,(sub.quantity-sub.drawqty) as actQty,   '
      
        'p.code as p_code,p.name as p_name,p.spec p_spec,u.unitid,u.unitn' +
        'ame,  '
      ' cast(0 as bit) as choice, m_bcode,  m.saleorderbcode, '
      'mp.code as mp_code,mp.name as mp_name, mp.spec as mp_spec, '
      ' rp.name as rp_name, rp.code as rp_code, rp.spec as rp_spec,   '
      '(d.quantity-d.drawqty)*sub.rate as quantity, d.workprocid,  '
      '(d.quantity-d.drawqty)*sub.rate as factsubqty,  '
      'sub.explan,null as custom1,null as custom2,null as custom3   '
      'from tb_mnfmachiningrawsub sub   '
      
        'left join v_tb_mnfmachining m on (sub.bid=m.bid and sub.bno=m.bn' +
        'o)   '
      
        'left join v_tb_mnfmachiningrawmaterials d on (d.bid=sub.bid and ' +
        'd.bno=sub.bno and d.bdtlno=sub.bdtlno)   '
      'left outer join td_product p on (sub.subproductid=p.p_id)    '
      'left outer join td_product mp on (mp.p_id=m.productid)   '
      'left outer join td_product rp on (rp.p_id=d.productid)   '
      
        'left outer join td_unitprice u on (sub.subproductid=u.productid ' +
        'and u.baseunit=1)   '
      
        ' where m.pause=0 and m_bstate=1 and m.workshopid=2 and m.quantit' +
        'y>m.completedqty+m.wasterqty and d.quantity>d.drawqty  '
      
        'and (m.completedqty+m.wasterqty=0 or (m.completedqty+m.wasterqty' +
        '>0 and d.drawqty>0))')
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Left = 80
    Top = 517
  end
  object dspRaw: TDataSetProvider
    DataSet = qryRaw
    UpdateMode = upWhereKeyOnly
    Left = 125
    Top = 444
  end
  object dspSub: TDataSetProvider
    DataSet = qrySub
    UpdateMode = upWhereKeyOnly
    Left = 125
    Top = 504
  end
  object cdsRaw: TClientDataSet
    Aggregates = <>
    Params = <>
    ProviderName = 'dspRaw'
    AfterScroll = cdsRawAfterScroll
    Left = 177
    Top = 460
  end
  object cdsSub: TClientDataSet
    Aggregates = <>
    Params = <>
    ProviderName = 'dspSub'
    Left = 177
    Top = 524
  end
  object dsRaw: TDataSource
    DataSet = cdsRaw
    Left = 221
    Top = 448
  end
  object dsSub: TDataSource
    DataSet = cdsSub
    Left = 221
    Top = 516
  end
end
